package com.iceland.common.util;

import io.netty.channel.Channel;
import io.netty.util.AttributeKey;

public class AttributeKeyUtils {

    protected static AttributeKey<ChannelContext> channelContextKey=AttributeKey.valueOf("com.iceland.common.ChannelContext");

    public static ChannelContext getChannelContext(Channel channel){
        return channel.attr(channelContextKey).get();
    }

    public static void setChannelContext(Channel channel,ChannelContext channelContext){
         channel.attr(channelContextKey).set(channelContext);
    }
}
